<script>
	$(function() {
		//默认选择个人账户
		$("input[value='PERSONAL']").attr("checked",true);
		var selectedValue = $("input[name='accountType']:checked").val();
		accountTypeChange(selectedValue);
		
		$(":radio").click(function(){
   			accountTypeChange($(this).val());
  		});
	});
	
	function accountTypeChange(value) {
		if (value == "PERSONAL") {
			$(".personalField").removeClass("hidden");
			$(".companyField").addClass("hidden");
		} else if (value == "ENTERPRISE") {
			$(".personalField").addClass("hidden");
			$(".companyField").removeClass("hidden");
		}
	}
</script>
<div class="ibox">
    <div class="ibox-title">
    	<h2 class="pull-left"><small>用户新建</small></h2>
    	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
    </div>
    	<div class="ibox-content">
    		<div class="pageContent">
    			<form class="form-horizontal m-t" id="ajaxForm" method="post" action="${basePath }/admin/memberInfo/save.do" >
    				<div class="pageFormContent">
    					<div class="form-group col-md-12 col-sm-12">
							<label class="col-md-2 col-sm-2 control-label">用户类型：</label>
							<div class="col-md-10 col-sm-10">
								<label class="radioButton"><input name="accountType" type="radio" value="PERSONAL" checked/>个人</label>
								<label class="radioButton"><input name="accountType" type="radio" value="ENTERPRISE"/>企业</label>
							</div>
						</div>
						<div class="form-group col-md-12 col-sm-12">
							<label class="col-md-2 col-sm-2 control-label"> 用户名：</label>
							<div class="col-md-10 col-sm-10 input-group has-feedback">
								<input class="form-control" name="userName" type="text" required/>
								<span class="glyphicon glyphicon-info-sign form-control-feedback" aria-hidden="true"></span>
							</div>
						</div>
						<div class="personalField hidden">
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label"> 真实姓名：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="personalName" type="text"/>
								</div>
							</div>
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label"> 手机号：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<span class="input-group-addon">+86</span>
									<input class="form-control" name="personalMobile" type="text"/>
								</div>
							</div>
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label">  邮箱：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="personalEmail" type="text" />
								</div>
							</div>
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label">  身份证：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="personalIdCard" type="text" />
								</div>
							</div>
						</div>
						<div class="companyField hidden">
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label"> 公司名：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="companyName" type="text"/>
								</div>
							</div>
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label">营业执照编号：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="companyNo" type="text" />
								</div>
							</div>
							<div class="form-group col-md-12 col-sm-12">
								<label class="col-md-2 col-sm-2 control-label">电话：</label>
								<div class="col-md-10 col-sm-10 input-group">
									<input class="form-control" name="companyTel" type="text" />
								</div>
							</div>
						</div>
    				</div>
    				<div class="formBar">
						<div class="ibox-content">
    						<button class="btn btn-primary" option="gridAjaxFormSave" >保存</button>
							<button type="button" class="btn btn-danger" data-dismiss="modal">取消</button>
						</div>
					</div>
    			</form>
    		</div>
    	</div>
    </div>
</div>
<!-- 引入事件绑定 -->
<script src="${basePath }/public/js/viewBind.js"></script>